package com.schoolET.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 流水表
 * </p>
 *
 * @author le
 * @since 2024-06-03
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@TableName("order_form")
@ApiModel(value = "OrderForm对象", description = "流水表")
public class OrderForm implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("商品主题ID")
    private Integer goodsId;

    @ApiModelProperty("卖家ID")
    private Integer sellerOpenId;

    @ApiModelProperty("买家ID")
    private Integer buyerOpenId;

    @ApiModelProperty("订单金额")
    private Long money;

    @ApiModelProperty("佣金")
    private Long commission;

    @ApiModelProperty("卖家收益")
    private Long sellMoney;

    @ApiModelProperty("卖家地址")
    private String sellerAddress;

    @ApiModelProperty("买家地址")
    private String buyerAddress;

    @ApiModelProperty("订单状态：0表示未完成，1表示完成，2表示进行中")
    private Integer orderStatus;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty("有效字段：0表示有效，1表示无效")
    private Integer flag;

    public OrderForm(Integer goodsId, Integer sellerOpenId, Integer buyerOpenId, Long money, Long commission, Long sellMoney, String sellerAddress, String buyerAddress, Integer orderStatus) {
        this.goodsId = goodsId;
        this.sellerOpenId = sellerOpenId;
        this.buyerOpenId = buyerOpenId;
        this.money = money;
        this.commission = commission;
        this.sellMoney = sellMoney;
        this.sellerAddress = sellerAddress;
        this.buyerAddress = buyerAddress;
        this.orderStatus = orderStatus;
    }
}
